<?php

require_once "core/application/models/mstigma/mstigma1.php";

class Mstigma2 extends Mstigma1 {

    private $_query;
    private $_fetch;

    protected function isOpenedSlots($nick) {
        /**
         * проверка на наличие открытых ячеек
         * @param mixed $nick
         * @return count of opened clots
         */
        DB::getInstance()->openConnectionToGS();
        $this->_query = "SELECT `advenced_stigma_slot_size` FROM `players` WHERE `name` = '$nick' AND `account_name` = '$_SESSION[name]'";
        $this->_fetch = mysql_fetch_assoc(DB::getInstance()->sql($this->_query));
        if ($this->_fetch['advenced_stigma_slot_size'] != '4' OR $this->_fetch['advenced_stigma_slot_size'] == '5') {
            return true;
            DB::getInstance()->closeConnection();
            unset($this->_query, $this->_fetch);
        } else {
            return false;
            DB::getInstance()->closeConnection();
            unset($this->_query, $this->_fetch);
        }
    }

}

?>
